

# 1:  dict1[key]
# 2:  dict1.get(key,default_value)

name_list = ['贾宝玉','林冲','猪八戒','赵子龙']
sign_list = ['红楼梦','水浒传','西游记','三国演义']
author_list=['曹雪芹','施耐庵','吴承恩','罗贯中']

name_sign_dict = dict(zip(name_list,sign_list))
sign_author_dict = dict(zip(sign_list,author_list))

print(sign_author_dict[name_sign_dict['贾宝玉']])
print(sign_author_dict.get(name_sign_dict.get('赵子龙')))


#==========遍历字典
#1 得到所有的键值对
for item in sign_author_dict.items():
    print(item)
    
for key,value in sign_author_dict.items():
    print(key," writeed by ",value)
    
for item in sign_author_dict.keys():
    print(item)
    
for item in sign_author_dict.values():
    print(item)